use std::{fs, path::Path};

pub fn is_dir(path: &str) -> bool {
    match fs::metadata(path) {
        Ok(meta) => meta.is_dir(),
        Err(_) => false,
    }
}

pub fn file_name(path: &str) -> String {
    match Path::new(path).file_name() {
        Some(file_name) => file_name.to_string_lossy().to_string(),
        None => path.to_string(),
    }
}
